<template>
	<view class="flex flex-clum align-center justify-center" style="height: 100%;">
		<view class="" :style="'height:'+statusHeight+'px;position:fixed;top:0;width:100%'">
			
		</view>
		<view class="flex align-center" style="font-size: 0;height: 88rpx;position: fixed;width: 100%;" :style="'top:'+statusHeight+'px;'">
			<image @click="goBack" style="width: 48rpx;height: 48rpx;margin-left: 28rpx;" src="../static/backArrow.png" mode=""></image>
		</view>
		<view class="flex align-center justify-center" style="font-size: 0;width: 128rpx;height: 128rpx;background: #EBBE87;border-radius: 50%;">
			<image style="width: 68rpx;height: 68rpx;" src="@/pages/filePages/static/Frame.png" mode=""></image>
		</view>
		<view class="flex justify-center" style="margin-top: 35rpx;margin-bottom: 100rpx;font-size: 32rpx;font-weight: 700;color: #844902;">
			填写完成
		</view>
		<view class="flex justify-center" style="font-size: 32rpx;color: #333333;margin-bottom: 110rpx;">
			请答题闯关完成入驻申请！
		</view>
		<view @click="goPage" class="flex align-center justify-center" style="width: 322rpx;height: 100rpx;background: #EBBE87;border-radius: 50rpx 50rpx 50rpx 50rpx;font-size: 32rpx;font-weight: 700;color: #FFFFFF;">
			去答题
		</view>
		<view class="flex align-center justify-center" v-if="show" style="position: fixed;width: 100%;height: 100vh;background: rgba(0, 0, 0, 0.2);">
			<view class="" style="width: 468rpx;height: 270rpx;background: #FFFFFF;border-radius: 32rpx;overflow: hidden;">
				<view class="flex align-center justify-center" style="height: 178rpx;font-size: 30rpx;color: #000000;font-weight: 700;">
					退出后将无法完成入驻申请
				</view>
				<view class="flex" style="border-top: 2rpx solid #F4F4F4;font-size: 30rpx;font-weight: 700;">
					<view @click="goBack" class="flex flex-1 align-center justify-center" style="border-right: 2rpx solid #F4F4F4;color: #999999;height: 92rpx;">
						退出({{miao}}s)
					</view>
					<view @click="show=false" class="flex flex-1 align-center justify-center" style="color: #333333;height: 92rpx;">
						取消
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				statusHeight:0,
				show:false,
				miao:3,
				timeName:'',
			}
		},
		methods:{
			goBack(){
				if(!this.show){
					this.show = true;
					this.timeName = setInterval(()=>{
						this.miao--;
						if(this.miao==0){
							clearInterval(this.timeName);
						}
					},1000)
				}else{
					if(this.miao==0){
						let pagelist = getCurrentPages();
						if(pagelist.length==2){
							uni.switchTab({
								url: "/pages/shopping/shopping"
							})
						}else{
							uni.navigateBack({
								delta:1
							})
						}
					}
				}
			},
			goPage(){
				uni.navigateTo({
					url:'/pages/answer/answer'
				})
			}
		},
		onLoad(options) {
			uni.getSystemInfo({
				success: res => {
					this.statusHeight = res.statusBarHeight;
				}
			});
			if(options.type==1){
				
			}
		}
	}
</script>
<style>
	page {
		height: 100%;
	}
</style>
<style scoped lang="scss">
	.flex-1 {
		flex: 1;
	}
	.flex {
		display: flex;
	}
	.align-center {
		align-items: center;
	}
	.justify-center {
		justify-content: center;
	}
	.flex-clum {
		flex-direction: column;
	}
</style>